//
//  DiagnosisListViewController.m
//  MobileChecker
//
//  Created by Lymons on 15-1-4.
//  Copyright (c) 2015年 Lymons. All rights reserved.
//

#import "DiagnosisListViewController.h"
#import "DiagnosisListViewModel.h"

@interface DiagnosisListViewController ()

@property (nonatomic, strong) IBOutlet UITableView *tableView;
@property (nonatomic) DiagnosisListViewModel *viewModel;
@property (strong, nonatomic) IBOutlet UILabel *versionLabel;

@end

@implementation DiagnosisListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.viewModel = [[DiagnosisListViewModel alloc] init];
    self.viewModel.tableViewCellIdentifier = @"DiagnosisListTableViewCell";
    self.tableView.dataSource = self.viewModel;
    
    NSString *File = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
    NSMutableDictionary* dict = [[NSMutableDictionary alloc] initWithContentsOfFile:File];
    self.versionLabel.text = [NSString stringWithFormat:@"%@%@", @"Ver: ", [dict objectForKey:@"App version"]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    if (self.needToCheckFromBegining) {
        [self.navigationController setViewControllers:@[self]];
    }
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    self.needToCheckFromBegining = NO;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)unwindSegueToListViewController:(UIStoryboardSegue *)segue {
    
}

@end
